package com.ruoyi.common.translation.impl;

import com.ruoyi.common.annotation.TranslationType;
import com.ruoyi.common.constant.TransConstant;
import com.ruoyi.common.core.service.ClassificationItemsService;
import com.ruoyi.common.translation.TranslationInterface;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;

@Component
@AllArgsConstructor
@TranslationType(type = TransConstant.ITEMS_ID_TO_NAME)
public class ItemsNameTranslationImpl implements TranslationInterface<String> {
    private final ClassificationItemsService classificationItemsService;
    @Override
    public String translation(Object key, String other) {
        return classificationItemsService.selectItemsNameById((Long) key);
    }
}
